<template>
    <div class="Main-Layout">
        <div class="Main-body" v-for="(item,index) in RouterConfig">
            <div class="Main-name">
                <Icon :type="item.icon" />{{item.name}}
            </div>
            <div class="Main-item-box">
                <router-link v-for="(child,index) in item.children" :key="'main_'+ index" :to="child.path">
                    <div class="Main-item">
                        <img v-if="child.image" :src="child.image" alt="">
                        <span>{{child.name}}</span>
                    </div>
                </router-link>
            </div>
        </div>
    </div>
</template>

<script>
// import RouterConfig from '../../../public/RouterConfig'
export default {
    data() {
        return {
            RouterConfig: window.RouterConfig
        }
    }
}
</script>
<style>
.Main-Layout {
    overflow-y: auto;
    height: 100%;
}

.Main-body {
    width: 80%;
    margin: 0 auto;
}

.Main-name {
    width: 100%;
    padding: 20px 0 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 20px;
    font-weight: bold;
}

.Main-name i {
    opacity: 0.7;
    margin: 0 15px 0;
}

.Main-item-box:after {
    content: "";
    display: block;
    height: 1px;
    clear: both;
}

.Main-item {
    width: 200px;
    height: 160px;
    border: 1px solid #ccc;
    margin: 20px 20px;
    float: left;
    position: relative;
    background-image: url(../../assets/no-image.png);
    background-size: 200px 120px;
    background-repeat: no-repeat;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s;
}

.Main-item img{
    display: block;
    width: 100%;
}

.Main-item:hover {
    opacity: 1;
    background-color: rgb(224, 224, 224);
    border: 1px solid rgb(113, 131, 209);
}

.Main-item span {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 0;
    line-height: 40px;
}
</style>
